HAL DMA2D constants migration

This section provides information about the HAL DMA2D constants migration.

HAL DMA2D error codes constants

HAL1

HAL2

#define HAL_DMA2D_ERROR_NONE
#define HAL_DMA2D_ERROR_TE
#define HAL_DMA2D_ERROR_CE
#define HAL_DMA2D_ERROR_CAE

#define HAL_DMA2D_ERROR_TIMEOUT
#define HAL_DMA2D_ERROR_INVALID_CALLBACK
#define HAL_DMA2D_ERROR_NONE
#define HAL_DMA2D_ERROR_TE
#define HAL_DMA2D_ERROR_CE
#define HAL_DMA2D_ERROR_CAE

Removed; These kinds of logical errors are reported by the direct function return.

Related concept:


HAL DMA2D status flags constants

HAL1

HAL2


#define DMA2D_FLAG_CAE
#define DMA2D_FLAG_CE
#define DMA2D_FLAG_CTC
#define DMA2D_FLAG_TC
#define DMA2D_FLAG_TE
#define DMA2D_FLAG_TW

Removed; use these LL instead:

#define LL_DMA2D_FLAG_CAEIF
#define LL_DMA2D_FLAG_CEIF
#define LL_DMA2D_FLAG_CTCIF
#define LL_DMA2D_FLAG_TCIF
#define LL_DMA2D_FLAG_TEIF
#define LL_DMA2D_FLAG_TWIF

Related concept:


HAL DMA2D interrupt identifiers constants

HAL1

HAL2


#define DMA2D_IT_CAE
#define DMA2D_IT_CE
#define DMA2D_IT_CTC
#define DMA2D_IT_TC
#define DMA2D_IT_TE
#define DMA2D_IT_TW

Removed; use these LL instead:

#define LL_DMA2D_IT_CAEIE
#define LL_DMA2D_IT_CEIE
#define LL_DMA2D_IT_CTCIE
#define LL_DMA2D_IT_TCIE
#define LL_DMA2D_IT_TEIE
#define LL_DMA2D_IT_TWIE

Related concept:


HAL DMA2D color component modes constants

HAL1

HAL2



#define DMA2D_CCM_ARGB8888
#define DMA2D_CCM_RGB888
typedef enum
{
  HAL_DMA2D_CLUT_COLOR_ARGB8888,
  HAL_DMA2D_CLUT_COLOR_RGB888
} hal_dma2d_clut_color_mode_t;

Related concepts:


HAL DMA2D alpha mode constants

HAL1

HAL2



#define DMA2D_NO_MODIF_ALPHA
#define DMA2D_REPLACE_ALPHA
#define DMA2D_COMBINE_ALPHA
typedef enum
{
  HAL_DMA2D_INPUT_ALPHA_NO_MODIF,
  HAL_DMA2D_INPUT_ALPHA_REPLACE,
  HAL_DMA2D_INPUT_ALPHA_COMBINE
} hal_dma2d_input_alpha_mode_t;

Related concepts:


HAL DMA2D inverted alpha mode constants

HAL1

HAL2



#define DMA2D_REGULAR_ALPHA
#define DMA2D_INVERTED_ALPHA
typedef enum
{
  HAL_DMA2D_ALPHA_INVERSION_DISABLED,
  HAL_DMA2D_ALPHA_INVERSION_ENABLED
} hal_dma2d_alpha_inversion_status_t;

Related concepts:


HAL DMA2D output swap mode constants

HAL1

HAL2


#define DMA2D_BYTES_REGULAR
#define DMA2D_BYTES_SWAP

Removed; use the following APIs instead:

HAL_DMA2D_DisableOutputByteSwap()
HAL_DMA2D_EnableOutputByteSwap()

HAL DMA2D line offset modes constants

HAL1

HAL2



#define DMA2D_LOM_PIXELS
#define DMA2D_LOM_BYTES
typedef enum
{
  HAL_DMA2D_LINE_OFFSET_PIXELS,
  HAL_DMA2D_LINE_OFFSET_BYTES
} hal_dma2d_line_offset_mode_t;

Related concepts:


HAL DMA2D transfer modes constants

HAL1

HAL2


#define DMA2D_M2M
#define DMA2D_M2M_PFC
#define DMA2D_M2M_BLEND
#define DMA2D_R2M
#define DMA2D_M2M_BLEND_FG
#define DMA2D_M2M_BLEND_BG

Removed; use those LL instead:

#define LL_DMA2D_MODE_M2M
#define LL_DMA2D_MODE_M2M_PFC
#define LL_DMA2D_MODE_M2M_BLEND
#define LL_DMA2D_MODE_R2M
#define LL_DMA2D_MODE_M2M_BLEND_FIXED_COLOR_FG
#define LL_DMA2D_MODE_M2M_BLEND_FIXED_COLOR_BG

Related concept:


HAL DMA2D output format definitions and red-blue swap modes constants

HAL1

HAL2

In HAL1, the user selects the chosen RGB output color format then selects the red and blue swap mode.



/* Red and blue swap mode */
#define DMA2D_RB_REGULAR
#define DMA2D_RB_SWAP


/* RGB output color format */
#define DMA2D_OUTPUT_ARGB8888
#define DMA2D_OUTPUT_RGB888
#define DMA2D_OUTPUT_RGB565
#define DMA2D_OUTPUT_ARGB1555
#define DMA2D_OUTPUT_ARGB4444

In HAL2, the red and blue swap mode definitions are merged with the output color format definitions that give the following enumeration (supporting RGB and BGR colors).

typedef enum
{
  HAL_DMA2D_OUTPUT_COLOR_ARGB8888,
  HAL_DMA2D_OUTPUT_COLOR_RGB888,
  HAL_DMA2D_OUTPUT_COLOR_RGB565,
  HAL_DMA2D_OUTPUT_COLOR_ARGB1555,
  HAL_DMA2D_OUTPUT_COLOR_ARGB4444,
  /* Output color format definitions with red-blue swap integrated */
  HAL_DMA2D_OUTPUT_COLOR_ABGR8888,
  HAL_DMA2D_OUTPUT_COLOR_BGR888,
  HAL_DMA2D_OUTPUT_COLOR_BGR565,
  HAL_DMA2D_OUTPUT_COLOR_ABGR1555,
  HAL_DMA2D_OUTPUT_COLOR_ABGR4444
} hal_dma2d_output_color_mode_t;

Related concepts:


HAL DMA2D input format definitions, color space selections and red-blue swap modes constants

HAL1

HAL2

In HAL1:

RGB input format: the user selects the chosen RGB input color format then selects the red and blue swap mode.

YCbCr input format: the user selects the YCbCr input color format then configures the chroma sub-sampling mode.

#define DMA2D_NO_CSS
#define DMA2D_CSS_422
#define DMA2D_CSS_420

#define DMA2D_RB_REGULAR
#define DMA2D_RB_SWAP

#define DMA2D_INPUT_ARGB8888
#define DMA2D_INPUT_RGB888
#define DMA2D_INPUT_RGB565
#define DMA2D_INPUT_ARGB1555
#define DMA2D_INPUT_ARGB4444
#define DMA2D_INPUT_L8
#define DMA2D_INPUT_AL44
#define DMA2D_INPUT_AL88
#define DMA2D_INPUT_L4
#define DMA2D_INPUT_A8
#define DMA2D_INPUT_A4

#define DMA2D_INPUT_YCBCR

Note

These constants might vary from a series to another.

In HAL2, the red and blue swap mode and the chroma sub-sampling mode definitions are merged with the input color format definitions that give the following enumeration (supporting RGB and BGR colors and supporting YCbCr 444, YCbCr 422 and YCbCr 420).

typedef enum
{
  HAL_DMA2D_INPUT_COLOR_ARGB8888,
  HAL_DMA2D_INPUT_COLOR_RGB888,
  HAL_DMA2D_INPUT_COLOR_RGB565,
  HAL_DMA2D_INPUT_COLOR_ARGB1555,
  HAL_DMA2D_INPUT_COLOR_ARGB4444,
  HAL_DMA2D_INPUT_COLOR_L8,
  HAL_DMA2D_INPUT_COLOR_AL44,
  HAL_DMA2D_INPUT_COLOR_AL88,
  HAL_DMA2D_INPUT_COLOR_L4,
  HAL_DMA2D_INPUT_COLOR_A8,
  HAL_DMA2D_INPUT_COLOR_A4,
  /* Input color format definitions with chroma sub-sampling integrated */
  HAL_DMA2D_INPUT_COLOR_YCBCR_444,
  HAL_DMA2D_INPUT_COLOR_YCBCR_422,
  HAL_DMA2D_INPUT_COLOR_YCBCR_420,
  /* Input color format definitions with red-blue swap integrated */
  HAL_DMA2D_INPUT_COLOR_ABGR8888,
  HAL_DMA2D_INPUT_COLOR_BGR888,
  HAL_DMA2D_INPUT_COLOR_BGR565,
  HAL_DMA2D_INPUT_COLOR_ABGR1555,
  HAL_DMA2D_INPUT_COLOR_ABGR4444
} hal_dma2d_input_color_mode_t;

Note

This enumeration might vary from a series to another.

Related concepts:


HAL DMA2D maximum layer number constant

HAL1

HAL2

#define MAX_DMA2D_LAYER

Used internally by the driver. Moved to DFP device header files.